﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css" />
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>FastSearch缓存代理的利器，比Dictionary快2倍以上</h3>
    这个类型是为了快速查找而开发的.之前dynamic，<br/>
    还有利用Dictionary存储IL生成代理的方式，其执行速度的最大的瓶颈在于字典的查找速度。<br />
    而现在则这个问题算是基本解决了。<br />
    快速查找类应用举例：<br />
    <pre class="brush:csharp;">
        using NFinal.Collections;
        public BaseController : OwinAction//或者CoreAction
        {
            /// &lt;summary>
            /// 该函数在项目加载时运行一次。
            /// &lt;/summary>
            public static void Configure(NFinal.Config.Plug.PlugConfig plugConfig)
            {
                Dictionary&lt;string, StringContainer> keyValueDictionary = new Dictionary&lt;string, StringContainer>();
                //此处可从数据库加载相关数据做为网站全局配置参数
                keyValueDictionary.Add("siteName", "站点名称");
                keyValueDictionary.Add("mobile","联系电话");
                //快速搜索函数
                plugConfig.keyValueCache = new NFinal.Collections.FastSearch.FastSearch&lt;StringContainer>(keyValueDictionary);
                systemConfigDictionary.Clear();
            }
        }
    </pre>
</body>
</html>